package net.tngou.crawler.runnable;

import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.PooledObjectFactory;
import org.apache.commons.pool2.impl.DefaultPooledObject;

public class MyPoolableObjectFactory implements PooledObjectFactory<BaseThread> {

	@Override
	public void activateObject(PooledObject<BaseThread> obj) throws Exception {
		
	}

	@Override
	public void destroyObject(PooledObject<BaseThread> obj) throws Exception {
		
	}

	@Override
	public PooledObject<BaseThread> makeObject() throws Exception {
		BaseThread dataThread = new BaseThread();
		dataThread.start();
		return new DefaultPooledObject<BaseThread>(dataThread);
	}

	@Override
	public void passivateObject(PooledObject<BaseThread> obj) throws Exception {
		
		
	}

	@Override
	public boolean validateObject(PooledObject<BaseThread> obj) {
	
		return false;
	}


}
